import React from 'react';
import { useTranslation } from 'react-i18next';
import { Text, TextStyle, StyleProp } from 'react-native';

export function CustomerText({
  style,
  onPress,
  children,
  numberOfLines,
  ellipsizeMode,
}: {
  style?: StyleProp<TextStyle>;
  onPress?: () => void;
  children: string;
  numberOfLines?: number;
  ellipsizeMode?: 'head' | 'middle' | 'tail' | 'clip';
}) {
  const { t } = useTranslation();
  return (
    <Text style={style} onPress={onPress} numberOfLines={numberOfLines} ellipsizeMode={ellipsizeMode}>
      {t(children)}
    </Text>
  );
}
